import '@/utils/environmentSetup';
import Vue from 'vue'
import XEUtils from 'xe-utils';
import VXETable from 'vxe-table';
import 'vxe-table/lib/index.css';
// import 'normalize.css/normalize.css' // A modern alternative to CSS resets
import 'BpmShowWorkflow/dist/BpmShowWorkflow.css';
import sessionSync from 'sync-session-storage'
import ElementUI from 'element-ui'
import HussarBaseUIComponent from 'HussarBaseUIComponent';
import 'HussarBaseUIComponent/dist/theme/index.css';
import '@/styles/element-variables.scss'
import locale from 'element-ui/lib/locale/lang/zh-CN' // lang i18n
import '@/styles/index.scss' // global css
// import '@/assets/css/lcdp_axe_ele.scss' // 表单设计器生成组件需要的样式覆盖
// import '@/assets/css/lcdp_axe_ionic.scss' // 表单设计器生成组件需要的样式覆盖
import numeral from 'numeral';
// 8.3.2版本后废弃使用，改为dayjs
import moment from 'moment';
import dayjs from 'dayjs';
import App from './ym2.vue'
// import store from '@/pages/index/store'
// import router from '@/pages/index/router/index'
// import '@/pages/index/permission' // permission control
import '@/directives/drag_dialog'
import '@/directives/click_outside'
import { initDefaultSVG } from '@/icons/svg';
import { initIndexMenu, initIndexCusMenu } from '@/icons/index';
import { initColorFulIcon } from '@/icons/colorfulIcon';
import { initCommonIcon } from '@/icons/common';

initDefaultSVG();
// 注册门户菜单图标
initIndexMenu();
// 注册用户自定义的菜单图标
initIndexCusMenu();
initColorFulIcon();
initCommonIcon();
// import permission from '@/pages/index/store/permission'
import lowcodePlugin from '@/pages/index/plugins/lowcode-plugin';
Vue.use(lowcodePlugin);
import { i18n } from 'hussar-base'
// import '@/pages/index/custom'
import '@/assets/css/themeConfig.css'
import { accountingNumFormat } from 'hussar-base'
import { InitThemeVars } from 'ThemeBase';
Vue.use(ElementUI, { locale });
Vue.use(HussarBaseUIComponent, { locale });
import { flowchartApi } from 'BpmShowWorkflow';
import echarts from 'echarts';
import '@/assets/font/lcdpFont/iconfont.js'
import '@/assets/font/lcdpFont/iconfont.css'
Vue.prototype.$echarts = echarts;
flowchartApi.setPrefix(process.env.VUE_APP_HUSSAR_DEFAULT_API);
Vue.use(VXETable);
Vue.prototype.$accountingNumFormat = accountingNumFormat;
Vue.prototype.$numeral = numeral;
Vue.prototype.$moment = moment;
Vue.prototype.$dayjs = dayjs;
Vue.prototype.$utils = XEUtils;
Vue.prototype.$cookie = XEUtils.cookie;
// Vue.prototype.$jsEncrypt = JsEncrypt
Vue.config.productionTip = false;
import 'hussar-icon/dist/hussar-icon.css';
import 'hussar-config/dist/hussar-config.css'
import 'hussar-common/dist/hussar-common.css'
// import 'hussar-unifiedtodo/dist/hussar-unifiedtodo.css'
import vClickOutside from 'v-click-outside'
Vue.use(vClickOutside);
// 互联网风格组件
import internetBaseUiComponent from 'InternetBaseUIComponent';
import 'InternetBaseUIComponent/dist/theme/index.css';
Vue.use(internetBaseUiComponent);
// 初始化主题cssVars
InitThemeVars();
// Vue.prototype.$permission = permission;
// 给 vue 实例挂载全局窗口对象，属性名称随意定义，例如：$XModal
Vue.prototype.$modal = VXETable.modal;
// // 工作流使用国际化
// Vue.prototype.$bpm_t = (key, value) => i18n.t(key, value);
// 当前 webpack 编译入口元信息
Vue.prototype.$compilationMetadata = {
    strategy: true,
};
new Vue({
    i18n,
    // router,
    // store: store,
    render: h => h(App)
}).$mount('#app');
window.vm = new Vue({ i18n: i18n });
//登录后在多个标签页同步sessionStorage
sessionSync.init({flag:'hussar'});
sessionSync.trigger();
//同步之后加载页面样式
sessionSync.afterSync(function (){
    window.document.documentElement.setAttribute('data-theme',sessionStorage.getItem('HussarIndexTheme'))
});
